<?php

use Faker\Generator as Faker;

/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/

/**
 * 方法一
 */
//普通文件
//第一个参数user模型类             回调函数
$factory->define(App\User::class, function (Faker $faker) {
    return [
        'name' => $faker->name,//表的字段 这里的字段对应的是要填充的数据中的字段
        'email' => $faker->unique()->safeEmail,
        'password' => bcrypt('admin888'), // secret
        'email_token' => str_random(10),
        'remember_token' => str_random(10),
//填充数据有两种方法

    ];
});
